# 基础镜像
FROM openjdk:17-slim
# author
MAINTAINER rtsp-hls-service

USER root

# 创建目录
RUN mkdir -p /home/qiuguo
#    \
#    && fc-cache -fv \
#    && ln -sf /usr/share/zoneinfo/Asia/Shanghai    /etc/localtime

# 指定路径
WORKDIR /home/qiuguo

# 更换镜像源并安装工具（包括 netstat）
RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list && \
    apt-get update && \
    apt-get install -y --no-install-recommends \
        iputils-ping \
        telnet \
        curl \
        ffmpeg \
        net-tools && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*
# 更换镜像源并安装工具（包括 netstat）
#RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list && \
#    apt-get update && \
#    apt-get install -y --no-install-recommends \
#        iputils-ping \
#        telnet \
#        curl \
#        net-tools && \
#    apt-get clean && \
#    rm -rf /var/lib/apt/lists/*
#RUN apt-get update && \
#    apt-get clean && \
#    rm -rf /var/lib/apt/lists/*
# 复制jar文件到路径
COPY rtsp-hls-service-1.0-SNAPSHOT.jar /home/qiuguo/

## 调整为+8时区
ENV TZ=Asia/Shanghai
# RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone


# 服务端口
EXPOSE 8090 8443

# 启动认证服务
CMD ["sh","-c", "java -jar rtsp-hls-service-1.0-SNAPSHOT.jar --rtsp.url=rtsp://192.168.50.193:8554/test --server.port=8090"]
